package com.changpay.zywy.adapter

import android.content.Context
import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.changpay.zywy.R
import com.changpay.zywy.bean.EarningDetailInfo
/**
 * Created by chenxz on 2018/4/22.
 */
class IncomeDetailAdapter(private val context: Context?, datas: MutableList<EarningDetailInfo>) :
    BaseQuickAdapter<EarningDetailInfo, BaseViewHolder>(R.layout.item_income_detail, datas) {

    override fun convert(helper: BaseViewHolder?, item: EarningDetailInfo?) {
        item ?: return
        helper ?: return
        helper.setText(R.id.tv_title, item.lg_type)
            .setText(R.id.tv_content, item.lg_desc)
            .setText(R.id.tv_time, item.lg_addtime)
            .setText(R.id.tv_money, item.lg_av_amount)
        if (item.lg_av_amount.contains("-"))
        {
            helper.setTextColor(R.id.tv_title,Color.parseColor("#FF01BDC4"))
                .setTextColor(R.id.tv_money,Color.parseColor("#FF01BDC4"))

        }
    }

}
